home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / ACKSRC.ZIP / NOTES.TXT < prev    next >
Text File  |  1993-06-20  |  31KB  |  816 lines

  1.                   ACK-3D
  2.          ( Animation Construction Kit 3D )
  3.  
  4.  
  5.                 Disclaimer
  6.  
  7.      The author, Lary Myers, and any other persons referred to
  8. in this documentation or in the computer programs ACK3D and MAPEDIT
  9. accept no responsibility for any loss of time, money or productivity,
  10. or damage to any person(s) or computer hardware or software, as a
  11. result of using the programs ACK3D and MAPEDIT, even if the above
  12. mentioned had knowledge or had been notified of the possibilities
  13. of such events.
  14.  
  15.  
  16.  
  17.                Distribution and Usage
  18.  
  19.      Considerable thought has gone into just how the source code for ACK3D
  20. would be released. Some possibilities included providing only the construction
  21. kit and selling the source to interested parties, or providing the source to
  22. be used as freeware for private use but requiring license for commercial ventures,
  23. and so forth.
  24.  
  25.      What I've decided is to release all the source, header files, notes, etc
  26. into the public domain as "PUBLICWARE". You may freely use the engine source
  27. and associated files for the programs ACK3D and MAPEDIT anyway you see fit.
  28. One of the goals when I started this project was to place the means into other
  29. peoples hands, more talented than I, so they could then create worlds of
  30. adventure and entertainment for the rest of us to share in.
  31.  
  32.      Here is the one reservation that I must insist on.
  33.  
  34.      The author, Lary Myers, hereby grants the right to use, modify, and sell
  35. the source code provided in the ACK3D collection of files, with the stipulation
  36. that Lary Myers accepts no responsibilty for changes desired in the code, bug
  37. fixes, or future updates.
  38.  
  39.  
  40.      Now, with all that aside, PLEASE let me know of any comments and/or
  41. suggestions you may have regarding possible uses for the engine and any
  42. enhancements you wish to share with me and others. The entire project is
  43. still far from over and together maybe we can create a powerful engine for
  44. use in a wide variety of applications.
  45.  
  46.  
  47.  
  48. ------------------------------------------------------------------------------
  49. Programming notes:
  50.  
  51. Author: Lary Myers
  52.  
  53.  
  54. Development system: 486DX 33Mhz
  55.             8 Meg RAM
  56.             210 Meg HD
  57.             Boca VGA
  58.             Microsoft mouse
  59.  
  60.             Borland C++ Version 3.1
  61.             Microsoft Macro Assembler Version 5.00A
  62.  
  63. Languages used:        C and Assembler
  64.  
  65. Model used:        Compact
  66.  
  67.  
  68. ------------------------------------------------------------------------------
  69. Compiling the engine:
  70.  
  71.     1. Place all of the files from the .ZIP file into one directory. Since I
  72.        use Borland I opted for the following directory structure;
  73.  
  74.     \BORLANDC\ACK3D\SRC    <- Contains all the source for the engine
  75.  
  76.     \BORLANDC\ACK3D\KIT    <- Contains executables, images, for the kit
  77.  
  78.     2. Several years ago I wrote a program called MK.EXE which was used to
  79.        MAKE programs based on dependencies, etc. Even though the compilers
  80.        nowadays have much better makes, I still use this old one of mine, so
  81.        the .MAK files provided with the engine are based on using it with
  82.        MK.EXE. You can either use them as is (if you have BorlandC) or use
  83.        them to see what's needed to create a standard MAKE file. If you use
  84.        MK then type in the following to begin the process;
  85.  
  86.         MK A   <- This will build the ACK3D engine
  87.  
  88.         MK M   <- This will build the Map Editor
  89.  
  90.  
  91.  
  92. ------------------------------------------------------------------------------
  93. Goals:
  94.     1. Create a 3D graphic engine which visually mimics the Wolfenstein
  95.        3D game as a starting point, then add new features and interface.
  96.  
  97.     2. Use the engine to create a generic construction kit.
  98.  
  99.     3. Provide the source and construction kit to the general public.
  100.  
  101.  
  102. Techniques:
  103.  
  104.     The graphic engine is based on a technique called Ray Casting, a term
  105. that has been used to describe the process where a 2D representation of a
  106. maze is rendered in 3D. The details of Ray Casting are provided below;
  107.  
  108.     1. Using a two dimensional map similiar to graph paper, a maze is built
  109.        consisting of borders (walls) in both the X and Y planes. These walls
  110.        describe the physical boundaries of the map. Figure 1 shows an example
  111.        of a simple map.
  112.  
  113.  
  114.      X
  115.     ╔════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╗
  116.       Y ║....║....║....║....║....║....║....║....║....║....║....║....║
  117.     ║....║....║....║....║....║....║....║....║....║....║....║....║
  118.     ╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
  119.     ║....║      ║    ║    ║     ║    ║       ║    ║    ║      ║    ║....║
  120.     ║....║      ║    ║    ║     ║    ║       ║    ║    ║      ║    ║....║
  121.     ╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
  122.     ║....║      ║    ║....║....║....║....║....║    ║      ║    ║....║
  123.     ║....║      ║    ║....║....║....║....║....║    ║      ║    ║....║
  124.     ╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
  125.     ║....║      ║    ║....║     ║    ║       ║....║    ║      ║    ║....║
  126.     ║....║      ║    ║....║     ║    ║       ║....║    ║      ║    ║....║
  127.     ╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
  128.     ║....║      ║    ║    ║     ║    ║       ║....║    ║      ║    ║....║
  129.     ║....║      ║    ║    ║     ║    ║       ║....║    ║      ║    ║....║
  130.     ╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
  131.     ║....║      ║    ║....║     ║    ║       ║....║....║....║....║....║
  132.     ║....║      ║    ║....║     ║    ║       ║....║....║....║....║....║
  133.     ╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
  134.     ║....║      ║    ║....║     ║    ║       ║    ║    ║      ║    ║....║
  135.     ║....║      ║    ║....║     ║    ║       ║    ║    ║      ║    ║....║
  136.     ╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
  137.     ║....║....║....║....║....║....║....║....║....║....║....║....║
  138.     ║....║....║....║....║....║....║....║....║....║....║....║....║
  139.     ╚════╩════╩════╩════╩════╩════╩════╩════╩════╩════╩════╩════╝
  140.  
  141.  
  142.     ╔════╗
  143.     ║....║    Indicates a square that has walls
  144.     ║....║
  145.     ╚════╝
  146.  
  147.     ╔════╗
  148.     ║    ║    Indicates a blank square
  149.     ║    ║
  150.     ╚════╝
  151.  
  152.  
  153.             Figure 1
  154.  
  155.  
  156.  
  157.  
  158.     2. The map is made up of cubes, each having a fixed size. For our
  159.        purposes we'll use 64x64 units for each square. This allows an
  160.        object (or player) to move 64 units in either the X or Y direction
  161.        before moving into another square. The total map is made up of
  162.        a number of squares to form rows and a number of rows to form a
  163.        two dimensional array (again, just like graph paper has some number
  164.        or sqaures by some number of rows of squares).
  165.  
  166.  
  167.     3. A player is then defined as a location on the map having three
  168.        properties, an X and Y coordinate as well as an Angle that the
  169.        player is currently facing. Figure 2 shows this relationship.
  170.  
  171.  
  172.  
  173.     ╔════╦════╦════╦════╦
  174.     ║....║....║....║....║
  175.     ║....║....║....║....║        P - The current location of the player
  176.     ╠════╬════╬════╬════╬
  177.     ║....║      ║    ║    ║        ->    The current angle the player is facing
  178.     ║....║ P->║    ║    ║
  179.     ╠════╬════╬════╬════╬
  180.     ║....║      ║    ║....║
  181.     ║....║      ║    ║....║
  182.     ╠════╬════╬════╬════╬
  183.     ║....║      ║    ║....║
  184.     ║....║      ║    ║....║
  185.     ╠════╬════╬════╬════╬
  186.  
  187.  
  188.             Figure 2
  189.  
  190.  
  191.  
  192.  
  193.     4. Once we know where the Player is and the current angle the player is
  194.        facing, we can begin to determine what will be visible at that moment
  195.        in time. To begin with, we need to decide on the field of vision that
  196.        will be used. ACK3D uses a 60 degree field of vision to show the
  197.        walls in a realistic setting. This means that the player will see all
  198.        items 30 degrees to the left of the current viewing angle to 30 degrees
  199.        to the right of the current angle. Figure 3 illustrates this.
  200.  
  201.  
  202.  
  203.             /
  204.               /       -30 degrees from viewing angle (VA - 30)
  205.             /
  206.           /
  207.         P ------------->  Current viewing angle (VA)
  208.           \
  209.             \
  210.               \       +30 degrees from viewing angle (VA + 30)
  211.             \
  212.  
  213.  
  214.             Figure 3
  215.  
  216.  
  217.  
  218.  
  219.  
  220.     5. As you can see, if we superimpose Figure 3 onto figure 2 we begin to
  221.        get a field of vision which encompasses those walls in front of the
  222.        player (at the current viewing angle). This gives us Figure 4.
  223.  
  224.  
  225.  
  226.       0    1    2     3
  227.     ╔════╦════╦════╦════╦
  228.       0 ║....║....║.../║....║
  229.     ║...